package com.university.report.model.vo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.university.report.model.entity.ReportInfo;
import com.university.report.model.entity.UserInfo;
import com.university.report.model.utils.TimeStampConverter;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.sql.Timestamp;

/**
 * @ClassName health_report
 * @Author Jinondo
 * @Date 2021/6/12 10:53
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ReportInfoVO {

    @ExcelProperty(value = "信息编号",index = 0)
    private Integer messageId;

    @ExcelProperty(value = "用户编号",index = 1)
    private Integer userId;

    @ExcelProperty(value = "提交日期",index = 2, converter = TimeStampConverter.class)
    private Timestamp reportDate;

    /**
     * the name of the member
     */
    @ExcelProperty(value = "姓名",index = 3)
    private String name;

    /**
     * the type of your identification certificate.
     */
    @ExcelProperty(value = "证件类型",index = 4)
    private String idType;

    @ExcelProperty(value = "证件号码",index = 5)
    private String idNumber;

    /**
     * identity catecory
     */
    @ExcelProperty(value = "身份类别",index = 6)
    private String identityCate;

    @ExcelProperty(value = "学校",index = 7)
    private String university;

//    private String campusRegion;

    @ExcelProperty(value = "院系",index = 8)
    private String department;

    /**
     * 家庭地址
     */
    @ExcelProperty(value = "家庭地址",index = 9)
    private String address;

    /**
     * 手机号码
     */
    @ExcelProperty(value = "手机号码",index = 10)
    private String phone;

    /**
     * 紧急联系人姓名
     */
    @ExcelProperty(value = "紧急联系人姓名",index = 11)
    private String emergencyContact;

    /**
     * 紧急联系人电话
     */
    @ExcelProperty(value = "紧急联系人电话",index = 12)
    private String emergencyContactNum;

    /**
     * 身体状况
     */
    @ExcelProperty(value = "身体状况",index = 13)
    private String healthCon;

    /**
     * 最近15天是否到达或途径疫情防控重点区域
     */
    @ExcelProperty(value = "最近15天是否到达或途径疫情防控重点区域",index = 14)
    private Integer impRegion;

    /**
     * 最近15天到达或途径疫情防控重点区域所在地，仅当上一个字段 imp_region 标志值为 1 时有效
     */
    @ExcelProperty(value = "最近15天到达或途径疫情防控重点区域所在地",index = 15)
    private String impRegionDir;

    /**
     * 最近15天是否接触过“近14天出入过疫情重点防控地区”的人员
     */
    @ExcelProperty(value = "最近15天是否接触过“近14天出入过疫情重点防控地区”的人员",index = 16)
    private Integer impTouch;

    /**
     * 最近15天是否接触过疑似病例/确诊病例
     */
    @ExcelProperty(value = "最近15天是否接触过疑似病例",index = 17)
    private Integer virusTouch;

    /**
     * 是否处于隔离医学观察
     */
    @ExcelProperty(value = "是否处于隔离医学观察",index = 18)
    private Integer isolated;

    /**
     * 目前所在地
     */
    @ExcelProperty(value = "目前所在地",index = 19)
    private String location;

    /**
     * 是否出入过当前所在城市
     */
    @ExcelProperty(value = "是否出入过当前所在城市",index = 20)
    private Integer cityTravel;

    /**
     * 出入过当前所在城市的目的城市，仅当 cityTravel 标志值为 1 时有效
     */
    @ExcelProperty(value = "出入过当前所在城市的目的城市",index = 21)
    private String travelCity;

    /**
     * 是否为重点人群
     */
    @ExcelProperty(value = "是否为重点人群",index = 22)
    private Integer focusGroups;

    /**
     * 最近是否在以下城市
     */
    @ExcelProperty(value = "最近是否在以下城市",index = 23)
    private Integer recentLoc;

    /**
     * 体温
     */
    @ExcelProperty(value = "体温",index = 24)
    private BigDecimal temperature;

    /**
     * 备注
     */
    @ExcelProperty(value = "备注",index = 25)
    private String remark;

    public ReportInfoVO(ReportInfo reportInfo, UserInfo userInfo) {
        this.messageId = reportInfo.getMessageId();
        this.userId = reportInfo.getUserId();
        this.reportDate = reportInfo.getReportDate();
        this.name = userInfo.getRealName();
        this.idType = userInfo.getIdType();
        this.idNumber = userInfo.getIdNumber();
        this.identityCate = userInfo.getIdentityCate();
        this.university = userInfo.getUniversity();
        this.department = userInfo.getDepartment();
        this.address = userInfo.getAddress();
        this.phone = userInfo.getPhone();
        this.emergencyContact = reportInfo.getEmergencyContact();
        this.emergencyContactNum = reportInfo.getEmergencyContactNum();
        this.healthCon = reportInfo.getHealthCon();
        this.impRegion = reportInfo.getImpRegion();
        this.impRegionDir = reportInfo.getImpRegionDir();
        this.impTouch = reportInfo.getImpTouch();
        this.virusTouch = reportInfo.getVirusTouch();
        this.isolated = reportInfo.getIsolated();
        this.location = reportInfo.getLocation();
        this.cityTravel = reportInfo.getCityTravel();
        this.travelCity = reportInfo.getTravelCity();
        this.focusGroups = reportInfo.getFocusGroups();
        this.recentLoc = reportInfo.getRecentLoc();
        this.temperature = reportInfo.getTemperature();
        this.remark = reportInfo.getRemark();
    }
}
